<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />  
        <title>订单统计</title>
    </head>
    <body>        
        <h1>订单统计</h1>
        <a href="javascript:history.back()">返回</a>
        <ul id="order">
            {% if not prefs_cnt %}
            <h2>无记录</h2>
            {% endif %}
            
            <h2>每个人的统计</h2>
            <table id="order">
            {% for user, user_orders in prefs_cnt.items %}
                <li><h3> {{user.last_name}} </h3></li>
                {% for order, count in user_orders.items %}
                    {{order}} - {{count}} <br>
                {% endfor %}
            {% endfor %}
            </table>
            
            {% if top_matches %}
            <h2>和我口味最接近的人</h2>
            <table id="top_matches" width="20%">
            {% for item in top_matches %}
                <tr><td>{{ item.1.last_name}}</td><td>{{item.0|stringformat:".3f"}}</td></tr>
            {% endfor %}
            </table>
            {% endif %}
                        
            <h2>口味相似度的统计</h2>
            <table id="sim" width="50%">
                <tr>
                    <td></td>
                    {% for user in user_set %}
                    <td>{{ user.last_name }}</td>
                    {% endfor %}
                </tr>
                
                {% for user1, user_sims in order_taste_sim.items %}
                    <tr>
                        <td>{{ user1.last_name }}</td>
                        {% for user2, sim in user_sims.items %}
                        <td>{{ sim|stringformat:".3f" }}</td>
                        {% endfor %}
                    </tr>
                {% endfor %}
            
            </table>
            
            <h2>菜肴推荐 1</h2>
            {% for item in recommendations %}
                <li>{{ item.1 }} - {{ item.0|stringformat:".3f" }}</li>
            {% endfor %}
            
            <h2>菜肴推荐 2</h2>
            {% for item in item_recommds %}
                <li>{{ item.1 }} - {{ item.0|stringformat:".3f" }}</li>
            {% endfor %}            
                    
        </ul>
       
        {% include 'message.html' %}
    </body>
    
</html>